<template>
    <div class='channelDailyContainer'>
        <div class='section'> 
            <div class='name'>
                <div class="line">
                    <span class="demonstration">选择时间</span>
                    <el-date-picker
                    v-model="value1"
                    type="date"
                    placeholder="选择日期">
                    </el-date-picker>
                </div>
                <div  class='line'>
                    <label>订单平台</label>
                    <el-select v-model="brandName" placeholder="请选择" filterable allow-create>
                        <el-option
                        v-for="item in brandList"
                        :key="item.id"
                        :label="item.bname"
                        :value="item.id">
                        </el-option>
                    </el-select>
                </div>
                <div class="line">
                    <label style="width:76px;text-align:center">订单公司</label>
                    <el-select v-model="brandName" placeholder="请选择" filterable allow-create>
                        <el-option
                        v-for="item in brandList"
                        :key="item.id"
                        :label="item.bname"
                        :value="item.id">
                        </el-option>
                    </el-select>
                </div>
            </div>
            <div class="lineButton">
                <el-button   @click="query" size="small">查询</el-button>
                <el-button   @click="reset" size="small">重置</el-button>
                <el-button   @click="exportExcel" size="small">导出</el-button>
            </div>
        </div>
        <div class="stand">
            <v-table :tableParams="tableParams" v-on:handleOperation="handleOperation"></v-table>
        </div>
        <div class="block">
            <el-pagination
                @current-change="handleCurrentChange"
                :current-page="pageIndex"
                :page-sizes="[10]"
                :page-size="10"
                layout="total, sizes, prev, pager, next, jumper"
                :total=pageCount>
            </el-pagination>
        </div>
    </div>
</template>

<script>
import VTable from "components/common/PageTable/VTable"
import api from 'js/service'
export default{
    data(){
        return{
            value1:'',
            brandName:'',
            // table总数量
            pageCount:0,
            pageIndex:1,
            brandList:[],
            //初始化商品信息list列表
            list:[],
            tableParams:{
                dataArray:[],
                showMultiSelection:false,
                columnArray:[
                    {label: '订单日期', prop: 'brandName',  sortable: false},
                    {label: '订单平台', prop: 'accreditLevel',  sortable: false},
                    {label: '订单公司', prop: 'channelName',  sortable: false},
                    {label: '订单数量', prop: 'accreditStartTime',sortable: false},
                    {label: '销售额', prop: 'accreditEndTime',sortable: false},
                    {label: '利润', prop: 'companyName',sortable: false},
                    {label: '客单价', prop: 'username',sortable: false}
                ],
                rowHandle:{
                    view:{
                        show:false
                    },
                    update:{
                        show:false
                    }
                }
            },
        }
    },
    created(){
        this.init()
    },

    methods: {
        init(){
          
        },
        handleOperation(rowIndex, row, methodName){

        },
        
        //查询接口
        query( ){
           
        },
        //重置按钮
        reset(){
           
        },
        //导出
        exportExcel(){
           
        },
        handleCurrentChange(val) {
          
        }, 
        //刷新商品列表
        refresh(){
            this.shopDetail()
        },
        //关闭弹窗
        closeDialog(){
            this.show=false;
            this.showtip=false;
        },
      
        //删除列表记录
        open(id){
            this.$confirm('是否删除该消息, 是否继续?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning',
            center: true
            }).then(() => {
                //删除商品信息
                let parmas={
                    id:id
                }
                let success=data=>{
                    if(data.code=='OK'){
                        this.shopDetail()
                        this.$message({
                        type: 'success',
                        message: '删除成功!'
                    });
                    }
                }
                api.productDelete(parmas,success)     
             
                }).catch(() => {
                this.$message({
                    type: 'info',
                    message: '已取消删除'
                });
            });
        },
    },
    components:{
        VTable
    }
   
}
</script>
<style scoped>
.channelDailyContainer .el-select {
    display: inline-block;
    position: relative;
    width:220px;
}
.channelDailyContainer .line .el-input__inner .el-input {
   height:35px;
   line-height:35px;
}
</style>
<style lang="scss" scoped>
 .channelDailyContainer{
    margin-left:15px;
    .section{
        width:99%;
        background: #fff;
        height:100px;
        .name{
            width:100%;
            display: flex;
            .line{
                display: inline-block;
                margin:10px 0 10px 0;
                flex:1;
                span{
                    display: inline-block;
                    width:80px;
                    text-align: left;
                    color:#606266;
                    font-size:15px;
                }
                input{
                    height: 38px;
                    width:220px;
                }
                button{
                    height:38px;
                    padding-left:20px;
                }
                .el-select{
                    width:225px;
                }
            }
        }
        
    }
    .stand{
        width:99%;
        height:100%;
    }
    .block{
        padding: 30px 24px;
        text-align: right;
    }
 }
</style>
